//
//  QrCodeView.swift
//  TalkeTv
//
//  Created by lhf on 2024/9/21.
//

import UIKit

class QrCodeView: CustomView {
    
    @IBOutlet weak var img: UIImageView!
    
    @IBAction func submit(_ sender: Any) {
        disappearView()
    }
    
    func disappearView() {
        UIView.animate(withDuration: 0.2, animations: {
            self.alpha = 0
        }) { (res) in
            if res {
                self.removeFromSuperview()
            }
        }
    }
    
    override func didMoveToWindow() { super.didMoveToWindow() ;print(#function) }

    override func willMove(toWindow newWindow: UIWindow?) { super.willMove(toWindow: newWindow) ;print(#function) }

    override func willMove(toSuperview newSuperview: UIView?) { super.willMove(toSuperview: newSuperview) ;print(#function) }

    override func didMoveToSuperview() {
        super.didMoveToSuperview();
    }

    override init(frame: CGRect) {
        super.init(frame: frame) ;
        print(#function)
        
        self.alpha = 0
        UIView.animate(withDuration: 0.2) {
            self.alpha = 1
        }
        
    }

    required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) ; print(#function) }

    override func layoutSubviews() { super.layoutSubviews() ;print(#function) }

    override func layoutSublayers(of layer: CALayer) { super.layoutSublayers(of: layer); print(#function) }

    override func display(_ layer: CALayer) { print(#function) }
    
    /*
    // Only override draw() if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    override func draw(_ rect: CGRect) {
        // Drawing code
    }
    */

}
